Fix some Clippy’s string_to_string warnings.
bail!("Passing multiple packages and `open` is not supported")
} else if options.compile_opts.spec.len() == 1 {
try!(PackageIdSpec::parse(&options.compile_opts.spec[0]))
- .name().replace("-", "_").to_string()
+ .name().replace("-", "_")
} else {
match lib_names.iter().chain(bin_names.iter()).nth(0) {
Some(s) => s.to_string(),
let git_config = GitConfig::open_default().ok();
let git_config = git_config.as_ref();
let name = git_config.and_then(|g| g.get_string("user.name").ok())
- .map(|s| s.to_string())
.or_else(|| env::var("USER").ok()) // unix
.or_else(|| env::var("USERNAME").ok()); // windows
let name = match name {
lines.next().unwrap().trim()
.split('_').skip(1).next().unwrap().to_string()
};
- Ok((dylib, exe_suffix.to_string()))
+ Ok((dylib, exe_suffix))
}
/// Prepare this context, ensuring that all filesystem directories are in
None if unit.target.allows_underscores() => {
unit.target.name().to_string()
}
- None => unit.target.crate_name().to_string(),
+ None => unit.target.crate_name(),
}
}
Some(desc) => {
let space = repeat(' ').take(description_margin - name.len())
.collect::<String>();
- name.to_string() + &space + &desc
+ name + &space + &desc
}
None => name
};